package com.wty.cmims.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wty.cmims.pojo.Code;
import com.wty.cmims.pojo.Opinion;
import com.wty.cmims.pojo.ResponseResult;
import com.wty.cmims.service.OpinionService;
import com.wty.cmims.mapper.OpinionMapper;
import org.springframework.stereotype.Service;

/**
* @author wty
* @description 针对表【opinion】的数据库操作Service实现
* @createDate 2025-03-09 15:59:02
*/
@Service
public class OpinionServiceImpl extends ServiceImpl<OpinionMapper, Opinion>
    implements OpinionService{

    @Override
    public ResponseResult<Void> addOpinion(Opinion opinion) {
        ResponseResult<Void> responseResult = new ResponseResult<>();
        if (this.save(opinion)){
            responseResult.setCode(Code.SUCCESS);
            responseResult.setMessage("提交成功");
        }else{
            responseResult.setCode(Code.ERROR);
            responseResult.setMessage("提交失败");
        }
        return responseResult;
    }
}




